'''
控制层：实现界面打印和菜单选择
'''
import  market
def main():
    while True:
        print("===============欢迎================")
        print(f'1.查看所有商品信息;\n 2.查找商品\n 3.添加商品\n 4.修改商品价格和折扣\n 5.删除商品\n 6.查看所有订单\n 7.删除订单\n 8.订单统计\n 9.商品结算')
        choice = int(input('请输入你的选择：'))
        if choice == 1:
            market.show_products()
        elif choice == 2:
            market.get_product()
        elif choice == 3:
            market.add_product()
        elif choice == 4:
            market.mod_product()
        elif choice == 5:
            market.del_product()
        elif choice == 6:
            market.show_orders()
        elif choice == 7:
            market.del_order()
        elif choice == 8:
            market.count_orders()
        elif choice == 9:
            market.add_orders()
            break
        else:
            print('输入有误')
if __name__ == '__main__':
    main()
